package org.openclinic.domain;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

@Entity
@DiscriminatorValue("3")
public class HealthProfessional extends Attendant {

	private static final long serialVersionUID = 5897039128673342442L;

	private String professionalNumber;

	private Set<MedicalSpecialty> specialties;

	@Column(name = "professional_number")
	public String getProfessionalNumber() {
		return professionalNumber;
	}

	public void setProfessionalNumber(String professionalNumber) {
		this.professionalNumber = professionalNumber;
	}

	@ManyToMany (fetch = FetchType.EAGER)
	@JoinTable(name="professional_specialty",
		joinColumns = @JoinColumn(name="user_id"), inverseJoinColumns = @JoinColumn(name="specialty_id"))
	public Set<MedicalSpecialty> getSpecialties() {
		return specialties;
	}

	public void setSpecialties(Set<MedicalSpecialty> specialties) {
		this.specialties = specialties;
	}
	
}